<me:UILIEFKO x:Class="WPFExcelReport.TSLS"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL"  
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"
                     xmlns:VL="clr-namespace:WPFExcelReport;assembly=TVERSART"  
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT" 
                    xmlns:ZA="clr-namespace:WPFExcelReport;assembly=TZABED"  
                    x:Name="TV"
                    FontSize="14"
                    Loaded="Window_Loaded"
     >
    <me:UILIEFKO.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:NOTConverter  x:Key="not"/>
    </me:UILIEFKO.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel>
            <WrapPanel  Grid.Row="0">
                <Grid Margin="10,0,0,0" >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition> 
                    </Grid.ColumnDefinitions>
                    <Button   Click="NewCommand" Height="20" Margin="5,0,0,0" Width="24" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Add.png" />
                        </Button.Background>
                    </Button>
            </Grid>
            <Grid Margin="10,0,0,0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                    <Button  Click="EditCommand" Width="24" Height="20">
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Edit.png" />
                        </Button.Background>
                    </Button>
            </Grid>
                <Grid Margin="10,0,0,0" >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button Click="DeleteCommand" Height="20" Margin="5,0,0,0" Width="24" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Remove.png" />
                        </Button.Background>
                    </Button>
                </Grid>
            <Grid Margin="10,0,0,0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                    <Button    Click="CopyCommand" Height="20" Margin="5,0,0,0" Width="24" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/copy.png" />
                        </Button.Background>
                    </Button>
            </Grid>
                <Grid Margin="10,0,0,0" Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                    <Button   Click="SaveCommand" Height="20" Margin="5,0,0,0" Width="24" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Save.png" />
                        </Button.Background>
                    </Button>
            </Grid>
        </WrapPanel>
            <me:TLS06 
                IsEdit="{Binding IsEdit,ElementName=TV}"
                IsSaved="{Binding IsSaved,ElementName=TV}" 
                KEY="{Binding ORDERNUM,ElementName=TV}"
                ORDERNUM="{Binding KEY,ElementName=TV}"/>
        </StackPanel>
        <DataGrid  Grid.Row="1"  
                   VerticalAlignment="Top" 
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                   HeadersVisibility="Column"  
                   ItemsSource="{Binding Source={StaticResource vwMaster}}"  
                   IsSynchronizedWithCurrentItem="True" 
                   IsReadOnly="True"
                   x:Name="dlgMaster" 
                   RowDetailsVisibilityMode="Visible"  
                >
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path=LSKLIEFNR}" Header="{Binding Source={Localization:Translate Word=供应商}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=LSKKONDSL}" Header="{Binding Source={Localization:Translate Word=组}}"  Width="Auto" /> 
                <!--DataGridTextColumn Binding="{Binding Path=LSKLIEFBED}" Header="{Binding Source={Localization:Translate Word=发货条件}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=LSKVERSART}" Header="{Binding Source={Localization:Translate Word=运输}}"   Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=LSKSPEDSL}" Header="{Binding Source={Localization:Translate Word=运输}}"   Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=LSKZAHLBED, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=付款方式}}"  Width="Auto" /-->
                <DataGridTextColumn Binding="{Binding Path=BANK, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=开户行}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ACCNAME, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=开户名}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ACCOUNT, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=帐号}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ADDR, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=地址}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=SWIFTCODE, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=SWIFTCODE}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=LSKAENB}" Header="{Binding Source={Localization:Translate Word=修改}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=LSKAEND}" Header="{Binding Source={Localization:Translate Word=日期}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=LSKNEUB}" Header="{Binding Source={Localization:Translate Word=创建}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=LSKNEUD}" Header="{Binding Source={Localization:Translate Word=日期}}"  Width="Auto" />
            </DataGrid.Columns>
        </DataGrid  >
    </Grid>
</me:UILIEFKO>
